#ifndef QIANDISK_INC_QD_SERVICES_H
#define QIANDISK_INC_QD_SERVICES_H

#include "inc/qd_datas.h"
#include "inc/qd_types.h"


#include "inc/FileIO.h"
#include "inc/NetFileIO.h"
#include "inc/FileTask.h"


#include <math.h>

#include "qd_env.h"


class QDServices {
private:
    SocketInfo *sockInfo;

public:
    QDServices() = default;

    // s server,  c client
    QDServices(const char *_mode);

    ~QDServices() = default;

    // 服务端创建Socket
    int CreateServer();

    // 客户端创建socket, 并连接服务器
    int CreateClient();

    // 支持的操作
    /*
        get/list?
        upload?filename
        download?filename
    */

   /*
        create?dir
        delete?dir
   */
    int Request(int fd);
    int Response(int fd);

    int UpLoad(int fd, QDReqParams *info);

    int DownLoad(int fd, QDReqParams *info);

};


#endif // QIANDISK_INC_QD_SERVICES_H

